home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Atari Mega Archive 1
/
Atari Mega Archive - Volume 1.iso
/
cli
/
tom_shel.lzh
/
TSH_REF.TXT
< prev
Wrap
Text File
|
1991-08-10
|
26KB
|
688 lines
TomShell Reference Manual
October 4, 1990
last revised August 10, 1991
Tom Clegg
Table of Contents
-----------------
0. 0.200! new features
1. TomShell Commands
alias dir ls system
author echo mkdir unalias
cat exit mv unset
cd help ren verbatim
cls history rm word
condense input rmdir
cp interact set
2. Batch file only commands
gosub resume
goto return
if :label
ifv
3. Special variables
0..99 dcdwatch keystat quick
anygem f margin resolution
cwd f1..f20 mem status
date font nolabel time
disk force owrite verbosity
dcd key PATH volume
********** NEW: pause, prompt, shortdir, width ***********
4. Special characters
> >> < $ \ # ; ! "
5. Explanations
.1 Batch files
.2 Errorlevels
.3 Filename completion
.4 Modes of Operation
.5 Output devices
.6 Running Programs
.7 Variables
=======================================================================
0. 0.200! New features
----------------------
.1 Finally, "ls" does good columns! The list goes down the first (left)
column, down the second column, down the third column, and so on.
This is much better for actually trying to find files. Maybe
eventually this will be used in the "help" command as well. :-)
.2 Two new variables have been implemented: pause and prompt. Check
out the appropriate sections in the manual (search for "(NEW)").
I'm especially proud of "prompt". :-) Why are there so many
happy faces here? :-)
.3 Two more variables have been implemented: shortdir and width. Again,
check for function later on.
.4 With all these new variables, the "set" output got far too long to
be useful (on a 25-line screen, all user variables were scrolled off
the top by the system variables), so the system variables are hidden
unless a "set s" command is given. Much nicer looking.
.5 Small and probably unnoticed feature removed: "alias f" would do
the "set f" output but preceded by "f= ". Rather insignificant,
but worth fixing anyway. :-)
1. TomShell Commands
--------------------
alias author cat cd cls condense
cp dir echo exit help history
input interact ls mkdir mv ren
rm rmdir set system unalias unset
verbatim word
alias assign a complex meaning to a simple word.
alias jim cat d:\stadel\money # `jim' now means `cat d:\...'
alias jim # what is "jim" aliased as?
alias # list all aliases
author display initial message about me and my address.
author
cat display a [text] file to the current output device. Can
be redirected via >whatever
cat file1
cat file1 file2
cd change current default (working) directory. Equivalent to
"set cwd ..."
cd e:\stadel\
cd \files\texts
cd d:\
cls clear the screen using the VT52 "esc E" command. Can
be redirected via >whatever
cls
condense take the spaces out of a variable's value.
condense blah # blah="foo bar" => blah="foobar"
cp copy files. If there is more than one argument, the last
one is considered to be the destination directory or file.
cp jimbob.doc joebob.asc # copy jimbob to joebob
cp fubar.txt \texts\ # copy fubar.txt to \texts\
cp fubar1.txt fubar2.txt \texts\
cp fu*.doc \texts\
cp fu*.doc # copy to current dir.
cp fubar.txt # copy to current dir.
dir list files in current or given directory. A search mask
or path may be given. Each file is displayed on a separate
line, with its size, date, time, and status bits displayed
in neat columns along with it. Subdirectories are denoted
by a trailing "\".
dir # list all files in cwd
dir \texts\ # list all files in \texts\
dir \texts\*.doc
dir *.txt *.doc g:\*.c
echo display the arguments to the current output device.
echo blah # output: blah<cr/lf>
echo # output: <cr/lf>
echo -n blah # output: blah
echo this is a test
echo -n this is a test
echo -n $disk;echo k # output: (eg) 763k
exit exit the current batch file or interactive session.
exit
exit 44 # sets $status to 44 and, if exiting
TomShell completely, returns 44
to the calling program.
(see also "system")
help display a list of available commands and reserved variables.
help
history display the last twenty commands entered, with line numbers.
These entries can be accessed with !# or !string (!# refers
to the line with the given number attached to it, !string
to the most recent command starting with "string").
history
input take one line of text input from the current input device
and place the received text in the given variable.
input name
input name <aux: >aux:
interact enter interactive mode until the command "exit" is issued.
See "Modes of Operation" below for more details.
ls display a short listing of files. Sytax is the same as
"dir", but the files are listed in columns of filenames
rather than with the size, date, time, etc.
mkdir create a directory (folder) with the given name.
mkdir tree
mkdir c:\blah
mkdir \test\phroo # note: \test will not be created
# if it doesn't already exist
mv identical to "cp" but, if a file is successfully copied,
the original file will be deleted.
ren rename a file
ren fubar.doc foobar.doc
ren jimbob \texts\ # jimbob -> \texts\jimbob
* Note: files can be renamed to anywhere on a logical drive
without being copied or moved (renaming is faster), but
not between drives.
* Note: under TOS 1.4 or greater, folders can also be
renamed.
rm delete the specified file or files.
rm fubar.txt
rm *.*
rm *.txt
rmdir delete the specified directory (folder)
rmdir test
rmdir c:\temp
* Note: trying to delete a non-empty directory will result
in an error message.
set change the value of a user or system variable, or, if the
variable specified does not exist, create a new variable
with the given information.
set name Tom
set verbosity 2
set name # display the contents of $name
set # list all user-defined variables
set s # list all system variables
set f # list function key macros
system exit all levels of TomShell and return to the calling
program. Differs from "exit" in that if it is called
from a nested batch file or an "interact" system, the
system will exit completely rather than going back one
level.
system
unalias remove an alias entry from the list
unalias v
unset remove a variable entry from the list
unset name
verbatim display a file to the console. NOTE: This will ONLY output
to the console and cannot be redirected. It provides the
advantage of being able to view a file containing non-ASCII
characters properly. Any character except for <cr> and <lf>
will be output as some form of character. Great for looking
at binary files (why?)
verbatim tomshell.ttp
word truncate the given variable to only one word (everything
before the first space)
word name # "Tom Clegg" -> "Tom"
2. Batch files only
-------------------
gosub goto if ifv resume return
:label
gosub branch to a given label until a "return" statement is
encountered, whereupon execution will continue from this
point
gosub test.label
goto branch to a given label
goto test.label.2
* Note: gosub, goto, and return work just like in BASIC.
if conditional statement, can use "and"/"or". Just like BASIC,
but the [in]equality operators are like C (==, !=, <, >,
<=, >=)
if <exp> and <exp> or <exp> then <cmd>
if $status >= 0 and $key == off then phroo.bat
if $status <0 or $key == on then fubar
if $status != 3 then gosub test.label.3
i